1. Field of the Invention
The present invention relates to a method, system, and article of manufacture for providing a process exclusive access to a page including a memory address to which a lock is granted to the process.
2. Description of the Related Art
Application processes may concurrently access memory addresses in a shared memory. A process may comprise one or more threads allocated processor and computer resources to execute computer instructions. Multiple processes or multiple threads in one process may concurrently execute instructions for one application, or multiple processes may concurrently execute instructions for multiple applications. Multiple processes may execute on multiple processors. The term “process” as used herein refers to a process, thread or any other unit of execution allocated to execute instructions. To access the memory addresses, the processes must obtain a spinlock for each address. If the spinlock is not available or granted to another process, then the process must repeatedly check until the spinlock becomes available. If one process holds the spinlock for a memory address, then other processes attempting to access that locked memory address continue to use processing resources to retry the access request until they obtain the spinlock. While a process is waiting to retry the request for a locked memory address to obtain the spinlock, the retrying process continually accesses the memory bus, which further consumes processing resources and delays other processes from accessing the memory bus. Thus, the use of spinlocks may be computationally expensive if one process holds the spinlock for an extended period of time while many other processes are waiting to access the spinlock for the memory address.
One technique for avoiding the costs of spinlocks is to provide the process seeking access to a memory address exclusive access to a page including the memory IP address. The published International Patent Application No. WO2006/077261, entitled “METHOD FOR MANAGING ACCESS TO SHARED RESOURCES IN A MULTI-PROCESSOR ENVIRONMENT”, and assigned to International Business Machines Corp., describes a technique to set the presence bit in the page table for the process having exclusive access to the page to indicate that the page is in the memory and set the presence bit for other processes to indicate that the page is not in the memory. Processes having the presence bit set to indicate the page is not in the memory will experience a page fault error preventing their access to the page to which exclusive access is granted. This page fault suspends the requesting process. Suspending the process trying to obtain the spinlock avoids costs associated with waiting processes retrying their request to obtain the spinlock.
There is a need in the art for further improved techniques for reducing costs associated with obtaining locks for shared memory addresses.